package com.pzl.intentservice;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }


    public void click(View v) {
        Intent intent = new Intent();
        intent.setClass(this, MyIntentService.class);
        switch (v.getId()) {
            case R.id.tv1:
                intent.putExtra("param", "step1");
                break;
            case R.id.tv2:
                intent.putExtra("param", "step2");
                break;
            case R.id.tv3:
                intent.putExtra("param", "step3");
                break;
        }
        startService(intent);
    }
}
